----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/figure_A2_sales_emp_va.log
  log type:  text
 opened on:   8 Nov 2022, 19:50:44

. *-------------------------------------------------------------------------------
. 
. 
. 
. *Assuming the technology transfer costs have an origin-specific component
. *-----------------------------------------------------------------
. clear all

. use year isocode type D_A* using "${data}/estimates_agg_naics_sales_s1_base_woparent.dta", clear

. rename D_A D_A_sales

. rename D_A_se D_A_sales_se

. merge 1:1 year isocode type using "${data}/estimates_agg_naics_emp_s1_base_woparent_salesempva.dta", keepusing(D_A*)

    Result                           # of obs.
    -----------------------------------------
    not matched                             0
    matched                                27  (_merge==3)
    -----------------------------------------

. rename D_A D_A_emp

. rename D_A_se D_A_emp_se

. drop _merge

. merge 1:1 year isocode type using "${data}/estimates_agg_naics_va_s1_base_woparent_salesempva.dta", keepusing(D_A*)

    Result                           # of obs.
    -----------------------------------------
    not matched                             6
        from master                         6  (_merge==1)
        from using                          0  (_merge==2)

    matched                                21  (_merge==3)
    -----------------------------------------

. rename D_A D_A_va

. rename D_A_se D_A_va_se

. drop _merge

. 
. 
. *Figure A2
. *-----------------------------------------------------------------
. foreach xx in D_A_sales D_A_emp D_A_va {
  2. gen u_`xx' = `xx' + 1.96 * `xx'_se
  3. gen l_`xx' = `xx' - 1.96 * `xx'_se 
  4. }
(6 missing values generated)
(6 missing values generated)

. keep year isocode type *D_A* 

. gsort D_A_sales

. drop year

. 
. gen t=_n

. sum t

    Variable |        Obs        Mean    Std. Dev.       Min        Max
-------------+---------------------------------------------------------
           t |         27          14    7.937254          1         27

. 
. forvalues ii=1(1)`r(max)' {
  2. local ctry`ii' = isocode[`ii']
  3. local obs`ii' = `ii'
  4. display "`ctry`ii'' ; `obs`ii''"
  5. }
JP ; 1
DE ; 2
IT ; 3
KR ; 4
FR ; 5
GB ; 6
ES ; 7
MX ; 8
PL ; 9
BE ; 10
AT ; 11
NL ; 12
RO ; 13
FI ; 14
SE ; 15
PT ; 16
GR ; 17
CZ ; 18
HU ; 19
DK ; 20
SK ; 21
HR ; 22
BG ; 23
SI ; 24
LV ; 25
LT ; 26
EE ; 27

. *
. 
. twoway rcap u_D_A_sales l_D_A_sales t, lc(red) /// 
> ||     rcap u_D_A_emp l_D_A_emp t, lc(blue) ///
> ||     rcap u_D_A_va l_D_A_va t, lc(green) /// 
> ||     scatter D_A_sales t, mc(red)  /// 
> ||     scatter D_A_emp t, mc(blue)  ///
> ||     scatter D_A_va t, mc(green)  ///
> yline(0) yline(0) ylab(-2(1)4) xlab(1(1)25)  legend(order(4 "sales" 5 "employment" 6 "value added") rows(1) size(medlarge) bplace(n) ring(0) region(lwidth(none)))  xlabel(, val
> uelabel) xlabel(, angle(45)) ytitle("") xtitle("") graphregion(fcolor(white) lcolor(white)) xlabel(`obs1' "`ctry1'" `obs2' "`ctry2'"  `obs3' "`ctry3'" `obs4' "`ctry4'" `obs5' "
> `ctry5'" `obs6' "`ctry6'" `obs7' "`ctry7'" `obs8' "`ctry8'" `obs9' "`ctry9'" `obs10' "`ctry10'" `obs11' "`ctry11'" `obs12' "`ctry12'" `obs13' "`ctry13'" `obs14' "`ctry14'" `obs
> 15' "`ctry15'" `obs16' "`ctry16'" `obs17' "`ctry17'" `obs18' "`ctry18'" `obs19' "`ctry19'" `obs20' "`ctry20'"  `obs21' "`ctry21'" `obs22' "`ctry22'" `obs23' "`ctry23'" `obs24' 
> "`ctry24'" `obs25' "`ctry25'" `obs26' "`ctry26'" `obs27' "`ctry27'", labsize(small)) 

. 
. graph export "${rappendix}/fig_A2_sales_emp_va.pdf", replace
(file F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/results/appendix/fig_A2_sales_emp_va.pdf written in PD
> F format)

. 
.         
. log close 
      name:  <unnamed>
       log:  F:/Dropbox (UBC-Umich)/Research_Projects/Project Javier and Natalia/TFP firm/TFP_firm_data_historical/dataverse_files/code/logs/figure_A2_sales_emp_va.log
  log type:  text
 closed on:   8 Nov 2022, 19:50:46
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
